<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title of the document</title>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>

<script type="text/javascript" >

	function validate() {

		userName = $("#userName").val();
		userId = $("#userId").val();
		password = $("#password").val();
		dob = $("#dob").val();
		mailId = $("#mailId").val();

/* 		var pattern = new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i);
	    boolean result=pattern.test(emailAddress);
	    if(result) {
	    	alert("Invalid emailId");
	    	return;
	    }
 */	    
	    if( userId == "" || userName == "" || password == "") {
	    	alert("Invalid user Name, Id, or password");
	    }

 		/*
 			Have to write code to submit the form, when all the fields are filed with proper values
 			else Form shouldn't be submitted
 		*/
 
	}

/* 
	$(document).ready(function(){
	}); 
 */	

</script>

</head>

<body>

	<form  id="userRegistration" action="service/UserRegistration.service" method="post">

		<input type="hidden" id="action" name="action" value="userRegistration" />

		<table id="userDetails">
			<tr>
				<td>User Name</td>
				<td><input id="userName" name="userName" type="text" /> </td>
			</tr>	
			<tr>
				<td>User Id</td>
				<td> <input id="userId" name="userId" type="text" /> </td>
			</tr>
			<tr>
				<td>Password</td>
				<td> <input type="password" name="password" id="password"/> </td>
			</tr>
			<tr>
				<td> Date of birth</td>
				<td> <input id="dob" name="dob" type="date"/>
			</tr>
			<tr>
				<td> email Id</td>
				<td> <input id="mailId" name="mailId" type="email"/>
			</tr>
			<tr>
				<td> <input id="submit1" type="submit" value="Submit"  /> </td>
				<td> <input id="clear" type="reset" value="Reset" /> </td>
			</tr>
			
		</table>
	</form>
</body>

</html>